<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue使用之模板语法指令</title>
    <script src="../vue.min.js" type="text/javascript"></script>
</head>
<body>
<div id="app">
    <input type="text" v-model="message" />
    <!--<button v-on:click="submit">提交</button>-->
    <button @click="submit">提交</button>
    <ul>
        <li v-for="item of list">{{item}}</li>
    </ul>
</div>

<script type="text/javascript">
    var app=new Vue({
        el: '#app',
        data:{
            //message:'hello'
            message:'',
            list:[]

        },
        methods: {
            submit:function () {
                // console.log(this.message)
                this.list.push(this.message);
                this.message=''
            }
        }
    })
</script>
</body>
</html>